﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using table_select;




public partial class modifypwd : System.Web.UI.Page
{
    public string  receive_userid, receive_password;
    
    protected void Page_Load(object sender, EventArgs e)


    {

       ///if(Session["MyForbid"]==null || Session["MyForbid"].ToString().Length==0){
           // Response.Redirect("login.aspx");
            // }
        //接收Login传递进来的参数！
        //string receive_userid, receive_password;

        receive_userid = Session["userid"].ToString();
        receive_password = Session["password"].ToString();
        TextBox1.Text = Session["name"].ToString();

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        string sql1 = "UPDATE system_users set psw='" + TextBox2.Text.ToString() + "'where user_id='" + receive_userid + "'";
        if (TextBox2.Text == TextBox3.Text)
        {
            tablesel.con_select(sql1);
            Response.Redirect("Login.aspx");
        }
        else
        {
            Response.Write("<script>alert('密码不一致，请重新确认密码！');</script>");
            TextBox2.Text = "";
            TextBox3.Text = "";
        
        
        }

    }
    protected void Button2_Click(object sender, EventArgs e)
    {
        this.TextBox1.Text = "";
        this.TextBox2.Text = "";
        this.TextBox3.Text = "";
        Response.Redirect("Login.aspx");
    }
}
